/*
 * LinkedList.cpp
 *
 *  Created on: Apr 6, 2013
 *      Author: Anthony Varghese
 */

#include <iostream>
#include <string>
using std::string;
using std::ostream;
using std::istream;

#include "LinkedList.h"

namespace assignment3 {

LinkedList::LinkedList() {
	first = NULL;
}

LinkedList::~LinkedList() {
	delete first;
	first = NULL;
}

LinkedList::LinkedList(const LinkedList& source){

}

LinkedList& LinkedList::operator =(const LinkedList& rhs){

	return *this;
}

void LinkedList::sortByName(){

}

void LinkedList::sortByPopularity(){

}

void LinkedList::sortByYear(){

}

ostream& operator<<(ostream& os, const LinkedList::Node& d){
	os << d.name << " " << d.year << " " << d.percent << " ";
	if (d.sex == assignment3::LinkedList::Node::boy)
		os << "boy";
	else
		os << "girl";
	return os;
}

istream& operator>>(istream& is, LinkedList::Node& d){
	string s; 	getline( is, s);

	is >> d.year >> d.name >> d.percent;

	string sex;  is >> sex;
	if (sex.compare("boy") == 0)
		d.sex = assignment3::LinkedList::Node::boy;
	else
		d.sex = assignment3::LinkedList::Node::girl;
	return is;
}


istream& operator>>(istream& is, LinkedList& bn){

	return is;
}
ostream& operator<<(ostream& os, const LinkedList& bn){

	return os;
}
} /* namespace assignment3 */
